package cn.iocoder.yudao.module.lowcode.controller.admin.generic.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

@Schema(description = "低代码 - 通用表格响应 VO")
@Data
public class GenericTableRespVO extends HashMap<String, Object> {

    @Schema(description = "记录ID", example = "1")
    public Long getId() {
        return (Long) this.get("id");
    }

    public void setId(Long id) {
        this.put("id", id);
    }

    @Schema(description = "创建时间")
    public LocalDateTime getCreateTime() {
        return (LocalDateTime) this.get("create_time");
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.put("create_time", createTime);
    }

    @Schema(description = "更新时间")
    public LocalDateTime getUpdateTime() {
        return (LocalDateTime) this.get("update_time");
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.put("update_time", updateTime);
    }

    /**
     * 设置动态数据
     */
    public void setData(Map<String, Object> data) {
        if (data != null) {
            this.putAll(data);
        }
    }

    /**
     * 获取动态数据（为了兼容性保留）
     */
    public Map<String, Object> getData() {
        return this;
    }

}